#include <cstdio>
#include <cmath>
#include <algorithm>

using namespace std;

typedef long double ld;
const int maxn=100000;
const ld eps=5.e-8;
int A;

ld sig(ld x) {return x==0 ? 0 : (x>0 ? 1 : -1);}

ld calc(ld pow, ld poi) {
    return 2*sig(pow)*(sqrt(abs(pow)+1)-1)-A*sig(poi)*(sqrt(abs(poi)+1)-1);
}

ld next(ld npow, ld pow, ld npoi, ld poi) {return npoi+calc(npow-pow, npoi-poi);}

class Tree {
    public:
        int m, ind[maxn+1], to[2*maxn-1], link[2*maxn-1], deg[maxn+1], pow[maxn+1], poi[maxn+1], nbro[maxn+1];
        ld f[maxn+1], g[maxn+1], h[maxn+1];

        void addSide(int u, int v) {
            m++;
            to[m] = v;
            link[m] = ind[u];
            ind[u] = m;
            deg[v]++;
        }

        void init(int o, int fa, ld npow, int npoi) {
            f[o] = -1e9;
            for (int i=ind[o]; i; i=link[i]) {
                if (to[i]!=fa) {
                    init(to[i], o, npow, npoi);
                    f[o] = max(f[o], next(npow, pow[o], f[to[i]], poi[o]));
                }
            }
            if (fa && deg[o]<=1) f[o] = next(npow, pow[o], npoi, poi[o]);
        }

        ld solve(int o, int fa, ld npow, int npoi) {
            static int s[maxn+1];
            ld tg=g[fa], th=h[fa], ret = deg[o]<=1 ? max(f[o], next(npow, pow[o], npoi, poi[o])) : 0;
            s[0] = 0;
            for (int i=ind[o]; i; i=link[i]) {
                s[++s[0]] = to[i];
            }
            g[s[1]] = -1e9;
            for (int i=2; i<=s[0]; i++) {
                g[s[i]] = max(g[s[i-1]], next(npow, pow[o], f[s[i-1]], poi[o]));
            }
            h[s[s[0]]] = -1e9;
            for (int i=s[0]-1; i>0; i--) {
                h[s[i]] = max(h[s[i+1]], next(npow, pow[o], f[s[i+1]], poi[o]));
            }

            for (int i=ind[o]; i; i=link[i]) {
                if (to[i]!=fa) {
                    ld tfs=f[to[i]], tfo=f[o];
                    f[o] = deg[o]<=1 ? next(npow, pow[o], npoi, poi[o]) : max(g[to[i]], h[to[i]]);
                    f[to[i]] = max(f[to[i]], next(npow, pow[to[i]], f[o], poi[to[i]]));
                    ret = max(ret, solve(to[i], o, npow, npoi));
                    f[to[i]] = tfs, f[o] = tfo;
                }
            }
            g[fa] = tg, h[fa] = th;
            return ret;
        }
};

int main() {
    freopen("pigeatyy.in", "r", stdin);
    freopen("pigeatyy.out", "w", stdout);

    static Tree tree;
    int n, po, pt, num;
    scanf("%d %d %d %d %d", &num, &n, &po, &pt, &A);
    for (int i=1; i<n; i++) {
        int u, v;
        scanf("%d %d", &u, &v);
        tree.addSide(u, v);
        tree.addSide(v, u);
    }

    for (int i=1; i<=n; i++) {
        scanf("%d %d", tree.pow+i, tree.poi+i);
    }

    ld ans=0;
    for (ld l=0, r=500000, mid; l<=r; ) {
        mid = (l+r)/2;
        tree.init(1, 0, mid, po);
        if (tree.solve(1, 0, mid, po)>=pt) {
            r = mid-eps;
            ans = mid;
        } else l = mid+eps;
    }
    printf("%.6LF", ans);

    fclose(stdin);
    fclose(stdout);
    return 0;
}
